package com.sys.service;

import java.sql.SQLException;

import com.sys.domain.User;

/**
 * @ClassName: UserService 
 * @Description: TODO(提供修改数据库中用户信息的业务层方法) 
 * @author 詹金浩 
 * @date 2018年3月10日 上午11:44:36
 */
public interface UserService {
	/**
	 * @Title: addUser 
	 * @Description: TODO(增加数据库中用户个数) 
	 * @param user
	 * @throws SQLException
	 */
	void addUser(User user) throws SQLException;
	
	/**
	 * @Title: isLegalUserById 
	 * @Description: TODO(学号是否合法) 
	 * @param userId
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean isLegalUserById(String userId) throws SQLException;
	
	/**
	 * @Title: findUserById 
	 * @Description: TODO(根据userId查找用户) 
	 * @param userId  
	 * @throws SQLException
	 * @return Boolean 查找到返回true，查找不到返回false
	 */
	Boolean findUserById(String userId) throws SQLException;
	
	/**
	 * @Title: isEmailExist 
	 * @Description: TODO(检验邮箱是否已被记录在数据库中) 
	 * @param eMail
	 * @return Boolean 存在返回真，不存在返回假
	 * @throws SQLException
	 */
	Boolean isEmailExist(String eMail) throws SQLException;
	
	/**
	 * @Title: checkUserIsExist 
	 * @Description: TODO(通过eMail或学号查询数据库中有无此用户) 
	 * @param str userPwd
	 * @return Boolean 有返回真，没有返回假
	 * @throws SQLException
	 */
	Boolean checkUserIsExist(String str, String userPwd) throws SQLException;
	
	/**
	 * @Title: getUserIdByEmail 
	 * @Description: TODO(通过eMail号返回用户id值) 
	 * @param eMail
	 * @return String
	 * @throws SQLException
	 */
	String getUserIdByEmail(String eMail) throws SQLException;
	
	/**
	 * @Title: deleteUser 
	 * @Description: TODO(删除指定用户) 
	 * @param user
	 * @return Boolean
	 * @throws SQLException
	 */
	Boolean deleteUser(User user) throws SQLException;
	
	/**
	 * @Title: checkUserInfoWhoChangePwd 
	 * @Description: TODO(修改密码) 
	 * @param @param userId eMail userPwd
	 * @return Boolean  修改成功返回真，失败返回假
	 * @throws SQLException
	 */
	Boolean changeUserPwd(String userId, String eMail, String userPwd, String newPwd) throws SQLException;
}
